package logic;

public class MoneyPassChecker implements PassChecker{
	private MetroCardRechargeable card;
	private final CardDataBase cardDataBase;
		
	public MoneyPassChecker( MetroCardRechargeable metroCard, CardDataBase cardDb ){
		card = metroCard;
		cardDataBase = cardDb;
	}
	
	@Override
	public boolean checkPass() {
            double passPrice = cardDataBase.getPassPrice();
            return card.subMoney(passPrice);
	}	
}
